<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<c:url value="/resources/jquery.js" />"></script>

<script type="text/javascript">
$(document).ready(function() {

// alert(1);
		 $.ajax({
			 beforeSend: function(req) {
// 			        req.setRequestHeader("Accept", "application/json");

			        req.setRequestHeader("Accept", "text/xml");
			    },
// 		        datatype:"json",
		        datatype:"xml",
// 		        type: "POST",
		        type: "GET",
		        url: "/cooknote/user.xml",
// 		        url: "/cooknote/user.json",
// 		        contentType: "application/json",
		        contentType: "application/xml",
// 		        data: $("#frmtest").serialize(),
		        success: function(response)
		        {
		            console.log(response);
		            $nick_name = $(response).find("user");
		            $nick_name.each(function(){
		            	var nick_name =  $(this).find("nick_name").text();
		            	alert(nick_name);

		            });
		        },
		        error: function(e)
		        {
		            console.log('Error: ' + e);
		        }
		    });

});
</script>
</head>
<body>

	<c:forEach var="result" items="${users}" varStatus="status">
	${result.user_id}-${result.nick_name} <br>
	</c:forEach>


</body>
</html>